    function showPostList(pageNo){
	           var jsonData = {roomMaster:$("#topic_roommaster").val(),pageNo:pageNo,roomId:$("#topic_roomid").val(),userId:$("#topic_userid").val()};
	           var url ="/post!findPostAll.jspa";
	           $.ajax({
	           cache:false,
			   type: "POST",
			   url: url,
			   data: jsonData,
			   dataType:"html",
			   success: function(html){
			        $(".posts").html(html);//shou html
			         //add face
			        $("#post_message_face").jqfaceedit("publishPostText"); 
			     	HoverLi(1,2,2);
			   }
		      });
         	
         }
         /**
		 * 
		 * @param textObj
		 * @returns
		 */
		function postWordChange(textObj){
			var surplusObj =$(".surplusPostNum");//
			wordNumberChange(textObj,surplusObj,300);
		}
		/**
		 * 发布帖子
		 */
		function publishPost(){
			
			/*************非登陆用户***********/
			if($("#topic_userid").val()==-1){
				alert("\u8bf7\u5148\u767b\u5f55!");
				return;
			}
			if($("#publishPostTitle").val().Trim()==""){
				alertDiv('',"\u5199\u70b9\u4e1c\u897f\u5427\uff0c\u6807\u9898\u4e0d\u80fd\u4e3a\u7a7a\u54e6\u3002",-1);//标题为空
				$("#publishPostTitle").focus();
				return;
			}
			if($("#publishPostText").val().Trim()==""){
				alertDiv('',"\u5199\u70b9\u4e1c\u897f\u5427\uff0c\u5185\u5bb9\u4e0d\u80fd\u4e3a\u7a7a\u54e6\u3002",-1);//内容为空
				$("#publishPostText").focus();
				return;
			}
			var surplusNum = $(".surplusPostNum").text();
			if(surplusNum<0){
				alert("\u53d1\u5e03\u5b57\u6570\u8d85\u8fc7\u9650\u5236!");
				("#publishPostText").focus();
				return;
			}
			   
		       var content =forceWriteHTML($("#publishPostText").jqfaceedit.Html("publishPostText"));
		       content="<span class=' Rcontent'>"+content+"</span>";
		       var jsonData = {roomMaster:$("#topic_roommaster").val(),roomId:$("#topic_roomid").val(),content:content,title:forceWriteHTML($("#publishPostTitle").val())};
	           var url ="/post!createPost.jspa";
	           $.ajax({
	           cache:false,
			   type: "POST",
			   url: url,
			   data: jsonData,
			   dataType:"json",
			   success: function(data){
			        if(data.result){
			        	 alertImg("alert_fbcg",3000);
			        	showPostList(1);
			        }else{
			        	 alertImg("alert_czsb",3000);
			        }
			        
			   }
		      });
			
		}
		
		function showPostInfo(postId,pageNo){
			var jsonData = {roomMaster:$("#topic_roommaster").val(),roomId:$("#topic_roomid").val(),id:postId,pageNo:pageNo};
	           var url ="/post!findPostInfo.jspa";
	           $.ajax({
	           cache:false,
			   type: "POST",
			   url: url,
			   data: jsonData,
			   dataType:"html",
			   success: function(html){
			        $(".posts").html(html);//shou html
			         //add face
			        $("#revert_post_message_face").jqfaceedit("revertPostText"); 
			     	HoverLi(1,2,2);
			   }
		      });
		}
		
		function revertPost(postId){
			/*************非登陆用户***********/
			if($("#topic_userid").val()==-1){
				alert("\u8bf7\u5148\u767b\u5f55!");
				return;
			}
		     var content =forceWriteHTML($("#revert_post_message_face").jqfaceedit.Html("revertPostText"));
		     if(content.Trim() == ""){
		    		alertDiv('',"\u5199\u70b9\u4e1c\u897f\u5427\uff0c\u5185\u5bb9\u4e0d\u80fd\u4e3a\u7a7a\u54e6\u3002",-1);//内容为空
		    		return ;
		     }
		     
		     content = "<span class='Rcontent'>"+content+"</span>";
		     if(!$("#revertDiv").is(":hidden")){//回复
		    	 content="<p class=\"rI_info3\">\u56de\u590d <a href=\"http://zone.17guagua.com/"+$("#revertUserNick").attr("user_id")+"\" target=\"_blank\" >"+$("#revertUserNick").html()+"</a>("+$("#revertFloor").html()+"\u697c):"+$("#revertContent").html()+"</p>"+content;

		     }
		     
			 var jsonData = {roomMaster:$("#topic_roommaster").val(),roomId:$("#topic_roomid").val(),content:content,parentId:postId};
	           var url ="/post!createComment.jspa";
	           $.ajax({
	           cache:false,
			   type: "POST",
			   url: url,
			   data: jsonData,
			   dataType:"json",
			   success: function(data){
			        if(data.result){
			        	 alertImg("alert_hfcg",3000);
			        	showPostInfo(postId,1);
			        }else{
			        	 alertImg("alert_czsb",3000);
			        }
			        
			   }
		      });
		}
		
		function delPost(id){
		    if(!confirm("\u786e\u5b9a\u5220\u9664\u5417?")){
		    	return ;
		    }
			var jsonData = {id:id,roomId:$("#topic_roomid").val()};
	           var url ="/post!delPostById.jspa";
	           $.ajax({
	           cache:false,
			   type: "POST",
			   url: url,
			   data: jsonData,
			   dataType:"json",
			   success: function(data){
			        if(data.result){
			        	 alertImg("alert_sccg",3000);
			        	showPostList(1);
			        }else{
			        	 alertImg("alert_czsb",3000);
			        }
			        
			   }
		      });
		}
		
		function deleteRevertPost(id,parentId){
		    if(!confirm("\u786e\u5b9a\u5220\u9664\u5417?")){
		    	return ;
		    }
			var jsonData = {id:id,parentId:parentId,roomId:$("#topic_roomid").val()};
	           var url ="/post!delCommentById.jspa";
	           $.ajax({
	           cache:false,
			   type: "POST",
			   url: url,
			   data: jsonData,
			   dataType:"json",
			   success: function(data){
			        if(data.result){
			        	alertImg("alert_sccg",3000);
			        	showPostInfo(parentId,1);
			        }else{
			        	alertImg("alert_czsb",3000);
			        }
			        
			   }
		      });
		}
		function revertPostText(id,floorNo,username,userid){
			var content = $("#postInfo_"+id+" .Rcontent").html();
//			content = content.replaceAll("<img src=\"/images/emoticons/","[em:");
			content = content.replaceAll(".gif\">",".gif\"\/>");
			if(content.length>25){
				content = content.substring(0,25);
				content = content+"..";
			}
			$("#revertUserNick").html(username);
			$("#revertUserNick").attr("user_id",userid);
			$("#revertFloor").html(floorNo);
			$("#revertContent").html(content);
			
		    
		    $("#revertDiv").show();
		    $("#revertPostText").focus();
		    window.scrollTo(0,document.body.scrollHeight-30);
		}
		
		function revertClose(){
			$("#revertDiv").hide();
		}
         
